#include "higv_cextfile.h"
#include "sample_utils.h"
#include "hi_gv_input.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /*  __cplusplus  */

static HI_U32 s_TimerId = 0;

HI_S32 SCROLLVIEW_WIN_IMAGE1_ontouchaction(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    (HI_VOID)HI_GV_Widget_Show(MAIN_WIN);
    (HI_VOID)HI_GV_Widget_Active(MAIN_WIN);
    (HI_VOID)HI_GV_Widget_Hide(SCROLLVIEW_WIN);

    return HIGV_PROC_GOON;
}

HI_S32 SCROLLVIEW_WIN_SCROLLVIEW1_onviewmove(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    return HIGV_PROC_GOON;
}

HI_S32 SCROLLVIEW_WIN_SCROLLVIEW1_onfinishfling(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    return HIGV_PROC_GOON;
}

HI_S32 SCROLLVIEW_WIN_onhide(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    return HIGV_PROC_GOON;
}

HI_S32 SCROLLVIEW_WIN_onrefresh(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    return HIGV_PROC_GOON;
}

HI_S32 SCROLLVIEW_WIN_onshow(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    return HIGV_PROC_GOON;
}

HI_S32 SCROLLVIEW_WIN_ontimer(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    return HIGV_PROC_GOON;
}

HI_S32 SCROLLVIEW_WIN_GROUPBOX_ongesturescroll(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    HI_GV_Msg_SendAsyncWithData(SCROLLVIEW_WIN_SCROLLVIEW1, HIGV_MSG_GESTURE_SCROLL, (HI_VOID *)lParam, wParam);

    return HIGV_PROC_GOON;
}

HI_S32 SCROLLVIEW_WIN_GROUPBOX_ongesturefling(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    HI_GV_Msg_SendAsyncWithData(SCROLLVIEW_WIN_SCROLLVIEW1, HIGV_MSG_GESTURE_FLING, (HI_VOID *)lParam, wParam);

    return HIGV_PROC_GOON;
}

HI_S32 SCROLLVIEW_WIN_ongesturescroll(HIGV_HANDLE hWidget, HI_PARAM wParam, HI_PARAM lParam)
{
    HI_S32 x, y;

    HI_GV_ScrollView_GetViewCoordinate(SCROLLVIEW_WIN_SCROLLVIEW1, &x, &y);

    printf("[Func: %s, Line: %d] x:%d, y:%d\n", __FUNCTION__, __LINE__, x, y);

    return HIGV_PROC_GOON;
}

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /*  __cplusplus  */
